package Servlet;

import java.io.IOException;
import java.io.PrintWriter;
import java.util.Iterator;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import DBModule.CourseTable;
import DBModule.TestPaperManager;
import Interact.Interface;
import Test.App;
import Test.Course;
import Test.Judge;
import Test.Question;
import Test.TestPaper;

/**
 * Servlet implementation class Test
 */
@WebServlet("/Test")
public class Test extends HttpServlet {
	private static int ct1 = 0, ct2 = 0;
	private static final long serialVersionUID = 1L;
       
    /**
     * @see HttpServlet#HttpServlet()
     */
    public Test() {
        super();
        ct1++;
    }

	/**
	 * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		// TODO Auto-generated method stub
		doPost(request, response);
	}

	private String head = "<html><head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\"><title>你的死期到了</title></head><body>";
	private String tail = "</body></html>";
	
	/**
	 * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		response.setCharacterEncoding("utf8");
		Interface inf = new Interface(request, response);
		inf.print(head);
		
		String str = request.getParameter("1");
		inf.println(str);
		inf.println("<p>");
		
		String strs[] = request.getParameterValues("1");
		for (String s : strs)
			inf.println(s);
		
		inf.print(tail);
		inf.flush();
	}
}













